package libs.yzx.zaza.acts2;

import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Paint;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

/**
 * Created by Administrator on 2016/9/26
 */

public class ColorMatrixActivity extends AppCompatActivity{

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ImageView iv = new ImageView(this);
        setContentView(iv);

        Bitmap bmp = Bitmap.createBitmap(1000, 1000, Bitmap.Config.ARGB_8888);
        for (int i = 0; i < bmp.getWidth(); i++) {
            for (int j = 0; j < bmp.getHeight(); j++) {
                bmp.setPixel(i,j, Color.RED);
            }
        }

        iv.setImageBitmap(bmp);
    }


    public void test(){
        ColorMatrix cm = new ColorMatrix();

        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint .setColorFilter(new ColorMatrixColorFilter(cm));

    }

}
